<div class='fui-page fui-page-current'>
    <div class="fui-header">
		<div class="fui-header-left">
			<a class="back" ng-click="goback()"></a>
		</div>
		<div class="title">{{pagedata.credit_title}}充值</div> 
		<div class="fui-header-right">&nbsp;</div>
    </div>
    <div class="fui-content">
		<div class='fui-cell-group'>
			<div class='fui-according'>
				<div class='fui-according-header' style="color: #666;line-height:1.2rem;padding-left:0.6rem">
					充值说明
					<div class="info" style="font-size:0.65rem;color:#666;line-height:1.2rem;padding-left:1rem">
						当前充值类型：<span class='text-danger bold'>{{pagedata.credit_title}}</span> 
						充值成功后将直接到账：<span class='text-danger'>个人会员账户</span> ，请注意查收！
					</div>
				</div>
			</div>
		</div>
		<div class='fui-cell-group'>
			<div class='fui-cell'>
				<div class='fui-cell-label'>当前{{pagedata.credit_title}}</div>
				<div class='fui-cell-info c000'>{{pagedata.nowcredit}} 个</div>
			</div>
		</div>
		<div class="fui-cell-group">
			<div class='fui-cell'>
				<div class='fui-cell-label'>充值个数</div>
				<div class="fui-cell-info c000"><input type="text" class='fui-input' placeholder="输入充值个数" ng-change="pagedata.uptifee()" ng-model="pagedata.post.jifen"></div>
			</div>
		</div>
		<div class="weui_btn_area" style="margin:1rem;">
				<div class="c" style="font-size:0.65rem;margin-top:-0.3rem;color:#999">
						充值个数：<span class='text-danger'>{{pagedata.post.jifen || 0}}</span>个 ，需支付：<span class='text-danger'>￥{{pagedata.post.fee || 0.00}} </span>			
				</div>
				<a class="weui_btn weui_btn_primary" style="border-radius:1rem;" ng-click="pagedata.recharge()">确认充值</a>
		</div>
</div>
<script>
scope.pagedata.uptifee=function(){
	scope.pagedata.post.fee=(scope.pagedata.post.jifen/scope.pagedata.post.rate).toFixed(2);
}
scope.pagedata.recharge=function(){
	scope.post_json('jy_merch/member.xunichong/recharge/',scope.pagedata.post,function(pay_id){
		var success_url='jy_merch/member.xunichong//type='+scope.pagedata.post.type;
		scope.tool.pay(pay_id,function(res){
				if(res.type=='success'){
					scope.message('支付成功！','success',success_url);
				}else{
					scope.message('支付失败！','success',success_url);
				}
		},'','',success_url,success_url);
	});
}
</script>